The International X-ray Project seeks to build an x-ray telescope using thousands of pieces of thin and flexible glass mirror segments. Each mirror segment must be bonded into a housing in nearly perfect optical alignment without distortion. Forces greater than 0.001 Newton, or displacements greater than 0.5 m of the glass, cause unacceptable optical distortion. All known epoxies shrink as they cure. Even the epoxies with the least amount of shrinkage (<0.01%) cause unacceptable optical distortion and misalignment by pulling the mirror segments towards the housing as it cures. A related problem is that the shrinkage is not consistent or predictable so that it cannot be accounted for in the setup (i.e., if all of the bonds shrunk an equal amount, there would be no problem). A method has been developed that allows two components to be joined with epoxy in such a way that reduces the displacement caused by epoxy shrinking as it cures to less than 200 nm. The method involves using ultraviolet-cured epoxy with a displacement sensor and a nanoactuator in a control loop. The epoxy is cured by short-duration exposures to UV light. In between each exposure, the nano-actuator zeroes out the displacement caused by epoxy shrinkage and thermal expansion. After a few exposures, the epoxy has cured sufficiently to prevent further displacement of the two components. Bonding of optical elements has been done for many years, but most optics are thick and rigid elements that resist micro-Newton-level forces without causing distortion. When bonding thin glass optics such as the 0.40-mm thick IXO X-ray mirrors, forces in the micro- and milli-Newton levels cause unacceptable optical figure error. This innovation can now repeatedly and reliably bond a thin glass mirror to a metal housing with less than 0.2 m of displacement (<200 nm). This is an enabling technology that allows the installation of virtually stress-free, undistorted thin optics onto structures. This innovation is applicable to the bonding of thin optical elements, or any thin/flexible structures, that must be attached in an undistorted, consistent, and aligned way.